/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2015 Microsoft Corporation
 *
 * -=- Robust Distributed System Nucleus (rDSN) -=-
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

include "../../idl/dsn.thrift"

namespace cpp dsn.fd

struct beacon_msg
{
    1: i64                      time;
    2: dsn.rpc_address          from_node;
    3: dsn.rpc_address          to_node;
    4: optional i64             start_time;
    5: optional dsn.host_port   hp_from_node;
    6: optional dsn.host_port   hp_to_node;
}

struct beacon_ack
{
    1: i64                      time;
    2: dsn.rpc_address          this_node;
    3: dsn.rpc_address          primary_node;
    4: bool                     is_master;
    5: bool                     allowed;
    6: optional dsn.host_port   hp_this_node;
    7: optional dsn.host_port   hp_primary_node;
}

struct config_master_message
{
    1: dsn.rpc_address          master;
    2: bool                     is_register;
    3: optional dsn.host_port   hp_master;
}
